#!/bin/bash

du -a $1 | while read SIZE FILE
do
  if [ -d $FILE ]; then
    printf "\n dir: $FILE."
    chmod a+rx $FILE
  elif [ -x $FILE ]; then
    printf "\n exe: $FILE."
    chmod a+rx $FILE
  else
    printf "\n file: $FILE."
    chmod a+r $FILE
  fi
done
